<section class="content-header">
    <h1>
        分型号节拍分析
        <!-- <small>Control panel</small> -->
    </h1>
</section>

<!-- Main content -->
<section class="content">
    <div class="row">
        <div class="col-md-3 col-md-push-9">
            <div class="box box-default">
                <div class="box-header with-border">
                    <h3 class="box-title">查询区域</h3>
                    <div class="box-tools pull-right">
                        <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
                    </div>
                </div>
                <!-- /.box-header -->
                <div class="box-body">
                    <div class="form-group">
                        <label for="DateTimeRange">时间</label>
                        <input type="text" class="form-control pull-right" id="DateTimeRange" placeholder="请选择日期" />
                    </div>
                    <div class="form-group">
                        <label>区域</label>
                        <dx-select-box #subArea style="width:100%;height:35px;margin-bottom:10px;border-radius: 0px" [items]="subAreaItems" displayExpr="subArea"
                            [(selectedItem)]="subAareSelected" (onValueChanged)="onSubAreaSelectedChange($event)" [value]="subAreaItems[0]"
                            [searchEnabled]="true">
                        </dx-select-box>
                    </div>
                    <div class="form-group">
                        <label>设备</label>
                        <dx-drop-down-box #dddb style="width:100%;height:35px;margin-bottom:10px;border-radius: 0px" [(value)]="equipmentSelected" displayExpr="equipment"
                            placeholder="请选择工位" [showClearButton]="true" [dataSource]="equipemntItems">
                            <dxo-drop-down-options [width]="510"></dxo-drop-down-options>
                            <div *dxTemplate="let data of 'content'">
                                <button type="button" (click)="clearEquipmentSelected()" class="btn btn-default btn-sm" title="重置">重置</button>&nbsp;&nbsp;&nbsp;
                                <button type="button" (click)="equipmentSelectedOk()" class="btn btn-info btn-sm" title="确定">确定</button>
                                <dx-data-grid [dataSource]="equipemntItems" [hoverStateEnabled]="true" [paging]="{ enabled: true, pageSize: 1000 }" [filterRow]="{ visible: true }"
                                    [(selectedRowKeys)]="equipmentSelected" [scrolling]="{ mode: 'infinite' }" [height]="265"
                                    [showColumnLines]="true" [showRowLines]="true" [showBorders]="true" [rowAlternationEnabled]="true">
                                    <dxo-selection [selectAllMode]="allPages" [showCheckBoxesMode]="always" mode="multiple"></dxo-selection>
                                    <dxi-column dataField="equipmentType" caption="设备类型" [width]="100">
                                    </dxi-column>
                                    <dxi-column dataField="supplier" caption="供应商" [width]="100">
                                    </dxi-column>
                                    <dxi-column dataField="stationCode" caption="工位" [width]="100">
                                    </dxi-column>
                                    <dxi-column dataField="equipment" caption="设备" [width]="100">
                                    </dxi-column>
                                </dx-data-grid>
                            </div>
                        </dx-drop-down-box>
                    </div>
                    <div class="form-group">
                        <label>班次</label>
                        <dx-select-box #shift style="width:100%;height:35px;margin-bottom:10px;border-radius: 0px" [items]="shiftItems" displayExpr="shiftName"
                            [(selectedItem)]="shiftSelected" [value]="shiftItems[0]" [searchEnabled]="true">
                        </dx-select-box>
                    </div>
                </div>
                <div class="box-footer">
                    <button type="button" class="btn btn-primary" (click)="getReportData()"> 查 询 </button>
                </div>
            </div>
        </div>
        <div class="col-md-9 col-md-pull-3">
            <div class="box box-default">
                <div class="box-header with-border">
                    <h3 class="box-title">分型号节拍分析</h3>
                    <div class="box-tools pull-right">
                        <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
                    </div>
                </div>
                <!-- /.box-header -->
                <div class="box-body">
                    <dx-data-grid [dataSource]="tctList" [showColumnLines]="true" [showRowLines]="true" [showBorders]="true" 
                    [rowAlternationEnabled]="true" (onExporting)="onExporting($event)">
                        <dxo-paging [pageSize]="10"></dxo-paging>
                        <dxo-export [enabled]="true" fileName="分型号节拍分析" [allowExportSelectedData]="false"></dxo-export>
                        <dxo-pager [showPageSizeSelector]="true" [allowedPageSizes]="[10, 20, 100]" [showInfo]="true">
                        </dxo-pager>
                        <dxi-column dataField="subArea" caption="生产线" [width]="80">
                        </dxi-column>
                        <dxi-column dataField="equipment" caption="工位/设备" [width]="80">
                        </dxi-column>
                        <dxi-column dataField="productDate" caption="工作日" [width]="100">
                        </dxi-column>
                        <dxi-column dataField="shift" caption="班次" [width]="80">
                        </dxi-column>
                        <!--放型号描述-->
                        <dxi-column dataField="partTypeDescription" caption="型号" [width]="80">
                        </dxi-column>
                        <dxi-column dataField="targetCycleTime" caption="额定CT" [width]="120">
                        </dxi-column>
                        <dxi-column dataField="actualCycleTime" caption="实际平均CT" [width]="120">
                        </dxi-column>
                        <dxi-column dataField="overTime" caption="超时时间" [width]="80">
                        </dxi-column>
                        <dxi-column dataField="overTimeCount" caption="超时次数" [width]="80">
                        </dxi-column>
                        <dxi-column dataField="gdparts" caption="合格" [width]="80">
                        </dxi-column>
                        <dxi-column dataField="rjparts" caption="次品" [width]="80">
                        </dxi-column>
                        <dxi-column dataField="totalCT" caption="总循环时间" [width]="120">
                        </dxi-column>
                    </dx-data-grid>
                </div>
            </div>
        </div>
    </div>
<!--
    <div class="row">
            <div class="col-md-12">
                <div class="box">
                    <div class="box-header with-border">
                        <h3 class="box-title">概率分布图(散点图)</h3>
                        <div class="box-tools pull-right">
                            <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                            </button>
                        </div>
                    </div>
                    <div class="box-body">
                        <div class="row">
                            <div class="col-md-9">
                                <div class="chart">
                                    <div echarts [options]="chartOption" (chartInit)="onChartInit(1,$event)" [loading]="showloading" class="demo-chart"
                                        style="height:300px;"></div>
                                </div>
                            </div>
                            <div class="col-md-3">
                                <ul  class="products-list product-list-in-box">
                                    <li class="item">
                                        <div style="margin-left:0px" class="product-info">
                                            <a href="javascript:return false" class="product-title">工位
                                            <span class="label label-success pull-right" style="width:120px; font-size:18px">{{statObject.equipment}}</span></a>
                                        </div>
                                    </li>
                                    <li class="item">
                                        <div style="margin-left:0px" class="product-info">
                                            <a href="javascript:return false" class="product-title">预设CT(秒)
                                            <span class="label label-success pull-right" style="width:120px; font-size:18px">{{statObject.ratect}}</span></a>
                                        </div>
                                    </li>
                                    <li class="item">
                                        <div style="margin-left:0px" class="product-info">
                                            <a href="javascript:return false" class="product-title">筛选百分比(%)
                                            <span class="label label-success pull-right" style="width:120px; font-size:18px">{{statObject.percent}}</span></a>
                                        </div>
                                    </li>
                                    <li class="item">
                                        <div style="margin-left:0px" class="product-info">
                                            <a href="javascript:return false" class="product-title">最大值(秒)
                                            <span class="label label-success pull-right" style="width:120px; font-size:18px">{{statObject.max}}</span></a>
                                        </div>
                                    </li>
                                    <li class="item">
                                        <div style="margin-left:0px" class="product-info">
                                            <a href="javascript:return false" class="product-title">最小值(秒)
                                            <span class="label label-success pull-right" style="width:120px; font-size:18px">{{statObject.min}}</span></a>
                                        </div>
                                    </li>
                                    <li class="item">
                                        <div style="margin-left:0px" class="product-info">
                                            <a href="javascript:return false" class="product-title">平均值(秒)
                                            <span class="label label-success pull-right" style="width:120px; font-size:18px">{{statObject.avg}}</span></a>
                                        </div>
                                    </li>
                                    <li class="item">
                                        <div style="margin-left:0px" class="product-info">
                                            <a href="javascript:return false" class="product-title">标准差
                                            <span class="label label-success pull-right" style="width:120px; font-size:18px">{{statObject.stdev}}</span></a>
                                        </div>
                                    </li>
                                    <li class="item">
                                        <div style="margin-left:0px" class="product-info">
                                            <a href="javascript:return false" class="product-title">有效样本数
                                            <span class="label label-success pull-right" style="width:120px; font-size:18px">{{statObject.count}}</span></a>
                                        </div>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-md-12">
                    <div class="box">
                        <div class="box-header with-border">
                            <h3 class="box-title">概率分布图(柱状图)</h3>
                            <div class="box-tools pull-right">
                                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                                </button>
                            </div>
                        </div>
                        <div class="box-body">
                            <div class="row">
                                <div class="col-md-9">
                                    <div class="chart">
                                        <div echarts [options]="chartLineOption" [loading]="showloading" (chartInit)="onChartInit(2,$event)" class="demo-chart"
                                            style="height:300px;"></div>
                                    </div>
                                </div>
                                <div class="col-md-3">
                                    <ul  class="products-list product-list-in-box">
                                        <li class="item">
                                            <div style="margin-left:0px" class="product-info">
                                                <a href="javascript:return false" class="product-title">工位
                                                <span class="label label-success pull-right" style="width:120px; font-size:18px">{{statObject.equipment}}</span></a>
                                            </div>
                                        </li>
                                        <li class="item">
                                            <div style="margin-left:0px" class="product-info">
                                                <a href="javascript:return false" class="product-title">预设CT
                                                <span class="label label-success pull-right" style="width:120px; font-size:18px">{{statObject.ratect}}</span></a>
                                            </div>
                                        </li>
                                        <li class="item">
                                            <div style="margin-left:0px" class="product-info">
                                                <a href="javascript:return false" class="product-title">筛选百分比
                                                <span class="label label-success pull-right" style="width:120px; font-size:18px">{{statObject.percent}}</span></a>
                                            </div>
                                        </li>
                                        <li class="item">
                                            <div style="margin-left:0px" class="product-info">
                                                <a href="javascript:return false" class="product-title">最大值
                                                <span class="label label-success pull-right" style="width:120px; font-size:18px">{{statObject.max}}</span></a>
                                            </div>
                                        </li>
                                        <li class="item">
                                            <div style="margin-left:0px" class="product-info">
                                                <a href="javascript:return false" class="product-title">最小值
                                                <span class="label label-success pull-right" style="width:120px; font-size:18px">{{statObject.min}}</span></a>
                                            </div>
                                        </li>
                                        <li class="item">
                                            <div style="margin-left:0px" class="product-info">
                                                <a href="javascript:return false" class="product-title">平均值
                                                <span class="label label-success pull-right" style="width:120px; font-size:18px">{{statObject.avg}}</span></a>
                                            </div>
                                        </li>
                                        <li class="item">
                                            <div style="margin-left:0px" class="product-info">
                                                <a href="javascript:return false" class="product-title">标准差
                                                <span class="label label-success pull-right" style="width:120px; font-size:18px">{{statObject.stdev}}</span></a>
                                            </div>
                                        </li>
                                        <li class="item">
                                            <div style="margin-left:0px" class="product-info">
                                                <a href="javascript:return false" class="product-title">有效样本数
                                                <span class="label label-success pull-right" style="width:120px; font-size:18px">{{statObject.count}}</span></a>
                                            </div>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
        </div>
-->
    </section>